import 'package:shared_preferences/shared_preferences.dart';

class TPreferences {
  static TPreferences _instance;
  SharedPreferences _sharedPreferences;

  Future<SharedPreferences> get get async {
    if (_sharedPreferences == null) {
      _sharedPreferences = await SharedPreferences.getInstance();
    }
    return _sharedPreferences;
  }

  factory TPreferences() {
    if (_instance == null) {
      _instance = TPreferences._();
    }
    return _instance;
  }

  TPreferences._() {
    _instance = this;
  }
}
